feat: add openAiOmitToolChoice setting for Azure/LiteLLM compatibility#10704
feat: add openAiOmitToolChoice setting for Azure/LiteLLM compatibility#10704roomote[bot] wants to merge 1 commit intomainfrom
Conversation
Add a new boolean setting that allows users to omit the tool_choice parameter from OpenAI API requests. This fixes compatibility issues with Azure-hosted models and LiteLLM proxies that do not support the tool_choice parameter. Fixes #10701
Review complete. No issues found. The implementation correctly adds the Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
Hey @statichawk It sounds like your provider and model combo are not compatible with native function calling, since we are deprecating our legacy tool calling which was based on XML parsing Roo Code might become incompatible with your provider. Can you test this workaround mentioned on the issue opened on the LiteLLM project? |
Thank you for a quick response. Would this be on the RooCode extension side, or our LLM provider side? |
|
OpenAI Compatible also need this seeting !!! pls add it . thanks! |
Related GitHub Issue
Closes: #10701
Roo Code Task Context (Optional)
N/A
Description
This PR attempts to address Issue #10701. Feedback and guidance are welcome.
Problem: Azure-hosted models (like GPT-5) accessed through LiteLLM proxies do not support the
tool_choiceparameter, causing 400 errors.Solution: Added a new boolean setting
openAiOmitToolChoicethat allows users to optionally omit thetool_choiceparameter from API requests.Changes:
openAiOmitToolChoice: z.boolean().optional()to theopenAiSchemainpackages/types/src/provider-settings.tssrc/api/providers/openai.tsto check forthis.options.openAiOmitToolChoicebefore includingtool_choicein requests (4 locations)webview-ui/src/components/settings/providers/OpenAICompatible.tsxfor users to enable this settingKey implementation details:
tool_choiceTest Procedure
tool_choicePre-Submission Checklist
Screenshots / Videos
N/A - Settings checkbox UI follows existing patterns in the codebase.
Documentation Updates
Additional Notes
The setting is added in the OpenAI Compatible provider settings, near the "Use Azure" checkbox, as it is related to Azure compatibility issues.
Get in Touch
N/A - Automated PR by Roomote
Important
Adds
openAiOmitToolChoicesetting to optionally omittool_choiceparameter for Azure/LiteLLM compatibility, with UI and API updates.openAiOmitToolChoiceboolean setting toopenAiSchemainprovider-settings.tsto optionally omittool_choiceparameter.OpenAiHandlerinopenai.tsto checkopenAiOmitToolChoicebefore includingtool_choicein API requests (4 locations).OpenAICompatible.tsxfor users to enable/disable this setting.settings.json.tool_choiceincluded unlessopenAiOmitToolChoiceis enabled.tool_choice.This description was created by
for 1b56f5e. You can customize this summary. It will automatically update as commits are pushed.